#include<bits/stdc++.h>

#define rp(i,a,b) for(int i=a;i<b;++i)
#define rrp(i,b,a) for(int i=b;i>=a;--i)

using namespace std;
std::vector<pair<int,int>> v;

int main(){
	int n;scanf("%d", &n);
	v.resize(n);
	rp(i , 0 , n){
		int x,y;scanf("%d%d", &x,&y);
		v[i] = make_pair(x,y);
	}
	sort(v.begin(),v.end());

	int ans = 0;
	rp(i , 0 , n){
		rp(j , i+1 , n){
			double tmp = (v[j].second-v[i].second)*1.0/(v[j].first-v[i].first);
			if(tmp>=-1&&tmp<=1){
				ans++;
			}
		}
	}
	printf("%d\n", ans);
	
	return 0;
}